home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / Newton Sample Code 1.2 / Routing / AutoRoute-1 / Project Data < prev    next >
Encoding:
Text File  |  1994-07-05  |  1.1 KB  |  39 lines  |  [TEXT/ttxt]

  1. // Copyright 1994 Apple Computer, Inc. All rights reserved.
  2. // by J. Christopher Bell, Newton DTS
  3.  
  4. DefConst ('kAppSymbol,        '|AutoRoute:PIEDTS|);
  5. DefConst ('kPrintFormat,      '|borderFormat:AutoRoute:PIEDTS|);
  6. DefConst ('kOtherPrintFormat, '|otherPrintFormat:AutoRoute:PIEDTS|);
  7.  
  8.  
  9. // run at application install time
  10. // setup stuff the app may need before it is ever opened
  11. InstallScript := func(partFrame)
  12. begin
  13.    local myApp := partFrame.theForm ;
  14.  
  15.    // put my routing frame in the global routing frame
  16.    routing.(kAppSymbol) := myApp.myRoutingFrame ;
  17.  
  18.    // put my format in the root so it can be found
  19.    GetRoot().(kPrintFormat) := BuildContext(myApp.myPrintFormat);
  20.    // put my other format in the root so it can be found
  21.    GetRoot().(kOtherPrintFormat) := BuildContext(myApp.otherPrintFormat);
  22. end;
  23.  
  24.  
  25. // run when application and/or card with app removed
  26. // cleanup routing stuff
  27. RemoveScript := func(packageFrame)
  28. begin
  29.    // get rid of entry in global routing frame
  30.    RemoveSlot(routing, kAppSymbol);
  31.  
  32.    // remove my print format
  33.    RemoveSlot(GetRoot(), kPrintFormat);
  34.  
  35.    // remove my print format
  36.    RemoveSlot(GetRoot(), kOtherPrintFormat);
  37. end;
  38.  
  39.